<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>南讯公众号管理后台登陆</title>
    {include file="/layout/scriptload"}
    <style>
        body{
            background-image: url("/../static/img/bg_login.jpg");
        }
        .contianer{
            width:450px;
            height: 460px;
            margin: 0 auto;
            background: rgba(137,137,137,0.5);

        }
        .logo{
            width: 100%;
            height: 250px;
        }
        .logo-name{
            width: 100%;
            height: 200px;
            line-height: 200px;
            font-weight: bold;
            text-align: center;
            font-size: 180px;
            color: #e6e6e6;
        }
        .logo-label{
            width: 100%;
            color: #676a6c;
            font-weight: bold;
            text-align: center;
        }
        .input-login{
            width: 100%;
            text-align: center;
        }
        .input-pwd{
            width: 100%;
            text-align: center;
            margin-top: 15px;
        }
        .input-login-style{
            width: 300px;
            height: 35px;
            font-size: 14px;
            border: 1px solid #e5e6e7;
            padding-left: 10px;
        }
        .input-btn-style{
            width: 300px;
            height: 35px;
            border: 0px;
            background: #1ab394;
            color: #ffffff;
        }
        .footer{
            width: 100%;
            height: 60px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .footer-list{
            color: #00bfff;
            margin-left: 15px;
            float: left;
        }
    </style>
</head>
<body>
<div style="width: 100%;height: 150px;"></div>
    <div class="contianer">
        <div class="logo">
            <div class="logo-name">NX</div>
            <div class="logo-label">欢迎使用 南讯管理后台</div>
        </div>
        <div class="input-login">
            <input type="text" class="input-login-style" name="login" id="login" placeholder="用户名">
        </div>
        <div class="input-pwd">
            <input type="password" class="input-login-style" name="password" id="password" placeholder="密码">
        </div>
        <div class="input-pwd">
            <input type="submit" class="input-btn-style" onclick="post()" value="登录">
        </div>
        <div class="footer">
            <div class="footer-list">人才第一</div>
            <div class="footer-list">不断创新</div>
            <div class="footer-list">钻研进取</div>
            <div class="footer-list">高效执行</div>
            <div class="footer-list">追求完美</div>
        </div>
    </div>
</body>
<script>
    function post() {
        var _login = $('#login').val();
        var _pwd = $('#password').val();
        if(_login === ''){
            layerAlert('请输入用户名');
            return false;
        }
        if(_pwd === ''){
            layerAlert('请输入密码');
            return false;
        }
        $.ajax({
            type: 'post',
            url: '{:url("User/login")}',
            data: {username:_login,password:_pwd},
            success:function(res){
                if(res.msg === 'ok'){
                    layerAlert('登录成功',function () {
                        window.location.href='{:url("admin/adminindex/adminindex")}';
                    });
                }else{
                    layerAlert('用户名或密码错误！');
                }
            }
        })
    }
</script>
</html>